#include "randomgenerator.h"

#include <cstdlib>

RandomGenerator::RandomGenerator(AbstractPresenter &presentor)
    : Presentor(presentor)
    , CurrentPlayer(0)
    , PlayersCount(3)
{}

void RandomGenerator::generate() {
    LimbKind limbs[] = { LK_LEFT_HAND, LK_RIGHT_HAND, LK_LEFT_LEG, LK_RIGHT_LEG };
    ColorKind colors[] = { CK_RED, CK_GREEN, CK_BLUE, CK_YELLOW };

    int limbNumber = rand() % 4;
    int colorNumber = rand() % 4;

    Answer an(CurrentPlayer, limbs[limbNumber], colors[colorNumber]);
    Presentor.display(an);

    CurrentPlayer = (CurrentPlayer + 1) % PlayersCount;
}
